function SettingsAssistant(){
	
}

SettingsAssistant.prototype.setup = function(){
	this.controller.listen('difficultySelector', Mojo.Event.propertyChange, this.difficultySelectorChanged.bindAsEventListener(this));
	this.controller.listen('daySelector', Mojo.Event.propertyChange, this.daySelectorChanged.bindAsEventListener(this));
	this.difficultyModel = {currentDifficulty: difficultySettings, currentDays: daysSettings}
	this.difficulty = [                  
			{label:$L('Easy'), value:"easy"}, 
			{label:$L('Medium'), value:"medium"}, 
			{label:$L('Hard'), value:"hard"}]
	this.days = [                  
			{label:$L('5'), value: 5}, 
			{label:$L('10'), value: 10}, 
			{label:$L('25'), value: 25},
			{label:$L('50'), value: 50},
			{label:$L('100'), value: 100}]
	this.controller.setupWidget('difficultySelector', { choices: this.difficulty, modelProperty:'currentDifficulty'}, this.difficultyModel);
	this.controller.setupWidget('daySelector', { choices: this.days, modelProperty:'currentDays'}, this.difficultyModel);	
}
SettingsAssistant.prototype.difficultySelectorChanged = function(event){
	difficultySettings = event.value;
	if (event.value == "easy"){
		money = 7.50;
	}else if (event.value == "medium"){
		money = 5.00;
	}else if (event.value = "hard"){
		money = 3.00;
	}
	dayNumber = 1;
}

SettingsAssistant.prototype.daySelectorChanged = function(event){
	dayNumber = 1;
	numberOfDays = event.value;
	daysSettings  = event.value;
}

SettingsAssistant.prototype.integerChanged = function(event){
	numberOfDays = event.value;
}

SettingsAssistant.prototype.handleCommand = function (event) {
	this.controller=Mojo.Controller.stageController.activeScene();
    if (event.type == Mojo.Event.commandEnable &&
	    (event.command == Mojo.Menu.helpCmd)) {
         event.stopPropagation(); // enable help. now we have to handle it
    }
	 if (event.type == Mojo.Event.commandEnable &&
	    (event.command == Mojo.Menu.prefsCmd)) {
         event.stopPropagation(); // enable help. now we have to handle it
    }

	console.log("RIGHT HERE");
	if (event.type == Mojo.Event.command) {
		var youOrdered = "";
		console.log("SettingsSceneAssistant::handleCommand(): Got command: " + event.command);
		switch (event.command) {
			
			// another built-in menu item, but we've enabled it (see below in this method)
			// so now we have to handle it:
			case Mojo.Menu.helpCmd:
				Mojo.Controller.stageController.pushScene('support');
				break;
				
			case Mojo.Menu.prefsCmd:
				Mojo.Controller.stageController.pushScene('settings');
				break;
		}
	}	
}

/*ettingsAssistant.prototype.handleCommand = function (event) {
	this.controller=Mojo.Controller.stageController.activeScene();
	 if (event.type == Mojo.Event.commandEnable &&
	    (event.command == Mojo.Menu.prefsCmd)) {
         event.stopPropagation(); // enable help. now we have to handle it
    }

	console.log("RIGHT HERE");
	if (event.type == Mojo.Event.command) {
		var youOrdered = "";
		console.log("SettingsSceneAssistant::handleCommand(): Got command: " + event.command);
		switch (event.command) {
			
			// another built-in menu item, but we've enabled it (see below in this method)
			// so now we have to handle it:
			case Mojo.Menu.prefsCmd:
				Mojo.Controller.stageController.pushScene('settings');
				break;
		}
	}	
}*/


SettingsAssistant.prototype.activate = function(event) {
	/* put in event handlers here that should only be in effect when this scene is active. For
	   example, key handlers that are observing the document */
}


SettingsAssistant.prototype.deactivate = function(event) {
	/* remove any event handlers you added in activate and do any other cleanup that should happen before
	   this scene is popped or another scene is pushed on top */
}

SettingsAssistant.prototype.cleanup = function(event) {
	/* this function should do any cleanup needed before the scene is destroyed as 
	   a result of being popped off the scene stack */
}